<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of ImgItem
 *
 * @author julien
 */
require_once 'Classes/View/ViewItems/ViewElement.php';
class ImgItem extends ViewElement{
    private $url;
    private $alt;
    private $height;
    private $width;
    
    public function __construct($url,$alt=null, $width=null,$height=null){
        $this->url = $url;
        $this->alt = $alt;
        $this->width = $width;
        $this->height = $height;
    }
    
    public function getHTML() {
       if($this->visible){

        $return ="";
        $return .='<img src="'.$this->url.'" ';
        if(! is_null($this->alt)){
            $return .='alt="'.$this->alt.'" ';
        }
        
        $return .=$this->getClassAndIdStatement();
        
       
        if(! is_null($this->height)){
            $return .='height="'.$this->height.'" ';
        }
        if(! is_null($this->width)){
            $return .='width="'.$this->width.'" ';
        }
        $return .='/>';
        $return .= $this->getEndingSpace();
        return $return;
       }
    }
}

?>
